<template>
    
  <h1>新闻列表展示</h1>
  <table border="1" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
    <tr>
        <td>新闻标题</td>
        <td>新闻内容</td>
        <td>作者</td>
    </tr>
  
  <tr v-for="news in newslist" :key="news.id">
    <td>{{ news.title }}</td>
    <td>{{ news.concent }}</td>
    <td>{{ news.authon }}</td>

  </tr>
</table>
</template>

<script setup>
import Axios from 'axios';
import { onMounted, ref } from 'vue';
var newslist = ref()
onMounted(()=>{
    Axios.get('http://127.0.0.1:8000/app/news/').then((result) => {
        console.log(result.data);
        newslist.value = result.data
    }).catch((err) => {
        
    });
})
</script>

<style>

</style>